<script setup lang="ts">
import UploadComponent from '@/components/Upload/index.vue'
import { useLoadingStore } from '@/stores/loading'
const store = useLoadingStore()
const open = () => {
  store.loadingOpen()
  setTimeout(() => {
    store.loadingClose()
  }, 2000)
}
// "geolocation" | "midi" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "storage-access";
// navigator.permissions.query({ name: 'geolocation' }).then((st) => {
//     console.log('🌈 —— data-st --->', st)
// })
// navigator.geolocation.getCurrentPosition((position) => {
//     console.log(position)
// })

const sendSystemNotification = () => {
  if (!('Notification' in window)) {
    // 检查浏览器是否支持通知
    alert('当前浏览器不支持桌面通知')
  } else if (Notification.permission === 'granted') {
    // 检查是否已授予通知权限；如果是的话，创建一个通知
    const notification = new Notification('你好！')
    // …
  } else if (Notification.permission !== 'denied') {
    // 我们需要征求用户的许可
    Notification.requestPermission().then((permission) => {
      // 如果用户接受，我们就创建一个通知
      if (permission === 'granted') {
        const notification = new Notification('你好！')
        // …
      }
    })
  }
}
</script>

<template>
  <div class="test-container base-card">
    test container
    <br />
    <div class="button-group">
      <button class="test-x" type="button">炫酷按钮</button>
    </div>
    <ElButton type="primary" @click="open"> open loading </ElButton>
    <input type="search" />
    <input type="week" />
    <input type="url" />
    <input type="checkbox" />
    <input type="color" />
    <input type="date" />
    <input type="datetime" />
    <input type="email" />
    <input type="file" />
    <input type="hidden" />
    <input type="range" />
    <input type="time" />
    <el-button type="primary" @click="sendSystemNotification">
      发送系统通知
    </el-button>

    <UploadComponent />
  </div>
</template>

<!-- <style scoped lang="scss">
@import './index.scss';
</style> -->
